home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
PC
/
MISCBAS
/
MASTERMD.ASC
< prev
next >
Wrap
Text File
|
1987-01-11
|
1KB
|
40 lines
100 PRINT:PRINT:PRINT :PRINT TAB(20)"** MASTERMIND **":PRINT
110 U$="### ! ! ! ! ! ## ##"
120 R=RND(1)
130 FOR I=1 TO 5
140 R=R*10:X$(I)=RIGHT$(STR$(INT(R)),1):R=R-INT(R)
150 NEXT I
160 PRINT:A$="00000":INPUT " INPUT A 5 DIGIT GUESS ";A$
170 PRINT " NO. GUESS RIGHT POSITIONS RIGHT NUMBERS"
180 FOR W=12 TO 1 STEP -1
190 IF W=12 THEN PRINT:GOTO 210
200 PRINT,"GUESS";:A$="00000":INPUT A$
210 A$=RIGHT$("00000"+A$,5)
220 FOR I=1 TO 5
230 Z$(I)=MID$(A$,I,1)
240 Y$(I)=Z$(I):L$(I)=X$(I)
250 NEXT I
260 C=0
270 FOR I=1 TO 5
280 IF Z$(I)<>L$(I) THEN 300
290 C=C+1:Z$(I)="10":L$(I)="11"
300 NEXT I
310 D=0
320 FOR I=1 TO 5
330 FOR J=1 TO 5
340 IF Z$(I)<>L$(J) THEN 360
350 D=D+1:Z$(I)="10":L$(J)="11"
360 NEXT J
370 NEXT I
380 PRINT USING U$;13-W;Y$(1);Y$(2);Y$(3);Y$(4);Y$(5);C;C+D;
390 IF C=5 THEN 440
400 NEXT W
410 PRINT:PRINT:PRINT "END OF GAME. YOU LOSE, DUMMY. THE CODE WAS ";
420 PRINT USING "! ";X$(1);X$(2);X$(3);X$(4);X$(5)
430 GOTO450
440 PRINT:PRINT:PRINT "***** YOU WIN IN ";13-W;"GUESSES":PRINT
450 PRINT:PRINT:GOTO 100
460 END
$(5)
430 GOTO450
440